//
//  BrandCell.m
//  一键车讯
//
//  Created by 江玉元 on 14/10/28.
//  Copyright (c) 2014年 lanou.3g.com. All rights reserved.
//

#import "BrandCell.h"
#import "Brand.h"
#import "UIImageView+WebCache.h"
@implementation BrandCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        self.brandImage = [[UIImageView alloc] init];
        [self.contentView addSubview:self.brandImage];
        [_brandImage release];
        
        self.nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.nameLabel];
        [_nameLabel release];
    }
    return self;
}

- (void)setBrand:(Brand *)brand
{
    if (_brand != brand) {
        [_brand release];
        _brand = [brand retain];
    }
    [self.brandImage setImageWithURL:[NSURL URLWithString:self.brand.brandImage]];
    self.nameLabel.text = self.brand.name;
    
    self.brandImage.frame = CGRectMake(20, 10, 40, 40);
    self.nameLabel.frame = CGRectMake(80, 20, 140, 20);

}

//- (void)layoutSubviews
//{
//    [super layoutSubviews];
//}

- (void)dealloc
{
    [_brandImage release];
    [_nameLabel release];
    [super dealloc];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
